package com.dreem.factory.simplefactory.pizzastore.pizza;

/**
 * @program: DesignParrtern
 * @description: 披萨提供商
 * @author: Peng
 * @create: 2021-01-24  11:21
 **/
public class PizzaProvide {
    private PizzaProvide(){
    }

    private static class PizzaProvideInstance{
        private static final PizzaProvide PIZZA_PROVIDE = new PizzaProvide();
    }

    public static PizzaProvide getInstance(){
        return PizzaProvideInstance.PIZZA_PROVIDE;
    }

    public Pizza providePizza(String orderType){
        Pizza pizza = null;
        if(orderType.equalsIgnoreCase("greek")){
            pizza = new GreekPizza();
        }else if(orderType.equalsIgnoreCase("beef")){
            pizza = new BeefPizza();
        }else if (orderType.equalsIgnoreCase("cheese")){
            pizza = new CheesePizza();
        }
        return pizza;
    }
}
